

package com.xy.entity.msg;

import com.alibaba.fastjson.annotation.JSONField;
import com.xy.common.jpa.AbstractTimestampEntity;
import com.xy.entity.User;
import com.xy.entity.product.Picture;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;
import java.util.*;

@Entity
@Data
public class ActivityMsg extends AbstractTimestampEntity {

    private int status;
    private String msgId;
    private Date pushTime;//推送时间
    private String title;//提示标题
    private String msg;//提示内容

    @Transient
    private int sum;//未读总数

  /*  @OneToMany(mappedBy = "activityMsg", cascade = CascadeType.ALL,fetch = FetchType.EAGER)*/
  @Transient
    private List<Picture> pictures = new ArrayList<>();

    @JSONField(serialize = false)
    @ManyToOne(cascade = {CascadeType.REFRESH},fetch = FetchType.EAGER)
    @JoinColumn(name = "userId")
    private User user;

}


